﻿using System;
using System.Collections;
using System.Collections.Generic;
using BLL.RF.Package;
using Model.RF.Package;

public partial class ViewbyProduct_ViewPackage_View2SNPackageData_View2SNUnionandPackageDatabyDT : System.Web.UI.Page
{
    private SNUnion u;
    private Package p;
    private DateTime dt1
    {
        get { return DateTime.Parse(ViewState["dt1"].ToString()); }
        set { ViewState["dt1"] = value; }
    }
    private DateTime dt2
    {
        get { return DateTime.Parse(ViewState["dt2"].ToString()); }
        set { ViewState["dt2"] = value; }
    }

    public ViewbyProduct_ViewPackage_View2SNPackageData_View2SNUnionandPackageDatabyDT()
    {
        u = new SNUnion();
        p = new Package();
    }

    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        dt1 = DateTime.Parse(this.TextBox1.Value.Trim());
        dt2 = DateTime.Parse(this.TextBox2.Value.Trim());
        BindSNUnionGV();
        BindPackageGV();
    }

    protected void BindSNUnionGV()
    {
        this.GridView1.DataSource = u.SNUnion_GetbyDT(dt1,dt2);
        this.GridView1.DataBind();
    }

    protected void BindPackageGV()
    {
        this.GridView2.DataSource = p.Package_GetbyDT(dt1,dt2);
        this.GridView2.DataBind();
    }

    protected void GridView1_PageIndexChanging(object sender, System.Web.UI.WebControls.GridViewPageEventArgs e)
    {
        this.GridView1.PageIndex = e.NewPageIndex;
        BindSNUnionGV();
    }

    protected void GridView2_PageIndexChanging(object sender, System.Web.UI.WebControls.GridViewPageEventArgs e)
    {
        this.GridView2.PageIndex = e.NewPageIndex;
        BindPackageGV();
    }
}
